home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Interapplication Communication / AE Interfaces / PInterfaces / AppleScript.p < prev    next >
Encoding:
Text File  |  1993-12-08  |  3.8 KB  |  138 lines  |  [TEXT/MPS ]

  1. {
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // OPEN SCRIPTING ARCHITECTURE: Client Interface
  4. ////////////////////////////////////////////////////////////////////////////////
  5. // Copyright © 1992 Apple Computer, Inc. All rights reserved.
  6. // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
  7. ////////////////////////////////////////////////////////////////////////////////
  8. // This interface defines what it means to be a "scripting component."
  9. // Scripting components allow "scripts" to be loaded and executed.  This
  10. // interface does not define the way in which a particular scripting
  11. // component's scripts are editing and debugged.
  12. ////////////////////////////////////////////////////////////////////////////////
  13. }
  14.  
  15. {$IFC UNDEFINED UsingIncludes}
  16. {$SETC UsingIncludes := 0}
  17. {$ENDC}
  18.  
  19. {$IFC NOT UsingIncludes}
  20.     UNIT AppleScript;
  21.     INTERFACE
  22. {$ENDC}
  23.  
  24. {$IFC UNDEFINED UsingAppleScript}
  25. {$SETC UsingAppleScript := 1}
  26.  
  27. {$I+}
  28. {$SETC AppleScriptIncludes := UsingIncludes}
  29. {$SETC UsingIncludes := 1}
  30. {$IFC UNDEFINED UsingAppleEvents}
  31. {$I $$Shell(PInterfaces)AppleEvents.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingComponents}
  34. {$I $$Shell(PInterfaces)Components.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED UsingOSA}
  37. {$I $$Shell(PInterfaces)OSA.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED UsingTextEdit}
  40. {$I $$Shell(PInterfaces)TextEdit.p}
  41. {$ENDC}
  42. {$SETC UsingIncludes := AppleScriptIncludes}
  43.  
  44. { Types and Constants }
  45. CONST
  46.     typeAppleScript                        = 'ascr';
  47.     kAppleScriptSubtype                    = typeAppleScript;
  48.     typeASStorage                        = typeAppleScript;
  49.  
  50. { Error Codes }
  51. CONST
  52.     { Runtime errors }
  53.     errASCantConsiderAndIgnore            = -2720;
  54.     errASCantCompareMoreThan32k            = -2721;
  55.  
  56.     { Compiler errors }
  57.     errASTerminologyNestingTooDeep        = -2760;
  58.     errASIllegalFormalParameter            = -2761;
  59.     errASParameterNotForEvent            = -2762;
  60.     errASNoResultReturned                = -2763;
  61.     
  62.     { Dialect specific errors }
  63.     { The range -2780 thru -2799 is reserved for dialect specific error codes. }
  64.     { (Error codes from different dialects may overlap.) }
  65.     
  66.     { English errors }
  67.     errASInconsistentNames                = -2780;
  68.  
  69. { Component Selectors }
  70.     kASSelectInit                    = $1001;
  71.     kASSelectSetSourceStyles        = $1002;
  72.     kASSelectGetSourceStyles        = $1003;
  73.     kASSelectGetSourceStyleNames    = $1004;
  74.  
  75. { OSAGetScriptInfo Selectors }
  76.     kASHasOpenHandler                = 'hsod';
  77.  
  78. { Initialization }
  79.  
  80. FUNCTION
  81. ASInit(scriptingComponent    : ComponentInstance;
  82.        modeFlags            : LONGINT;
  83.        minStackSize            : LONGINT;
  84.        preferredStackSize    : LONGINT;
  85.        maxStackSize            : LONGINT;
  86.        minHeapSize            : LONGINT;
  87.        preferredHeapSize    : LONGINT;
  88.        maxHeapSize            : LONGINT)
  89.     : OSAError;
  90.     INLINE $2F3C, $001C, $1001, $7000, $A82A;
  91.  
  92. { Default Initialization Parameters }
  93. CONST
  94.     kASDefaultMinStackSize                =  4 * 1024;
  95.     kASDefaultPreferredStackSize        = 16 * 1024;
  96.     kASDefaultMaxStackSize                = 16 * 1024;
  97.     kASDefaultMinHeapSize                =  4 * 1024;
  98.     kASDefaultPreferredHeapSize            = 16 * 1024;
  99.     kASDefaultMaxHeapSize                = 32 * 1024 * 1024;
  100.  
  101. { Source Styles }
  102.  
  103. FUNCTION
  104. ASSetSourceStyles(scriptingComponent    : ComponentInstance;
  105.                   sourceStyles            : STHandle)
  106.     : OSAError;
  107.     INLINE $2F3C, $0004, $1002, $7000, $A82A;
  108.  
  109. FUNCTION
  110. ASGetSourceStyles(scriptingComponent        : ComponentInstance;
  111.                   VAR resultingSourceStyles    : STHandle)
  112.     : OSAError;
  113.     INLINE $2F3C, $0004, $1003, $7000, $A82A;
  114.  
  115. FUNCTION
  116. ASGetSourceStyleNames(scriptingComponent                : ComponentInstance;
  117.                       modeFlags                            : LONGINT;
  118.                       VAR resultingSourceStyleNamesList    : AEDescList)
  119.     : OSAError;
  120.     INLINE $2F3C, $0008, $1004, $7000, $A82A;
  121.  
  122. CONST
  123.     kASSourceStyleUncompiledText            = 0;
  124.     kASSourceStyleNormalText                = 1;
  125.     kASSourceStyleLanguageKeyword            = 2;
  126.     kASSourceStyleApplicationKeyword        = 3;
  127.     kASSourceStyleComment                    = 4;
  128.     kASSourceStyleLiteral                    = 5;
  129.     kASSourceStyleUserSymbol                = 6;
  130.     kASSourceStyleObjectSpecifier            = 7;
  131.     kASNumberOfSourceStyles                    = 8;
  132.  
  133. {$ENDC}    { UsingAppleScript }
  134.  
  135. {$IFC NOT UsingIncludes}
  136.     END.
  137. {$ENDC}
  138.